package com.wulian.common.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PhoneNumVerify {
    /**
     * @Description: 验证手机号码
     * @Param:
     * @return:
     * @Author: lm-66
     * @Date: 2019/11/20
     */
    public static boolean isMobileNO(  String mobiles) {
        boolean flag = false;
        //String regex = "0\\d{2,3}[-]?\\d{7,8}|0\\d{2,3}\\s?\\d{7,8}|13[0-9]\\d{8}|15[1089]\\d{8}";
        //String regex = "0\\d{2,3}[-]?\\d{7,8}|0\\d{2,3}\\s?\\d{7,8}|((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$";
        String regex = "^1[\\d]{10}";
        try {
            Pattern pattern = Pattern.compile(regex);
            Matcher m = pattern.matcher(mobiles);
            flag = m.matches();
        } catch (Exception e) {
            flag = false;
        }
        return flag;
    }
}
